package com.mavenq.fly.annotation;

import org.springframework.stereotype.Component;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 重试
 *
 * @author liuzhengliang
 * @date 2022/2/25 17:08
 */
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@Component
public @interface Retry {

    /**
     * 重试次数
     *
     * @return
     */
    int retryTime() default 2;

    /**
     * 重试间隔(默认1s)
     *
     * @return
     */
    long retryPeriod() default 1000L;

}
